package com.pig4cloud.pig.admin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pig.admin.api.entity.BsAircorpManageEntity;
import com.pig4cloud.pig.admin.mapper.BsAircorpManageMapper;
import com.pig4cloud.pig.admin.service.BsAircorpManageService;
import com.pig4cloud.pig.common.security.util.SecurityUtils;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * 航空公司管理
 *
 * @author pig
 * @date 2025-04-03 17:45:40
 */
@Service
public class BsAircorpManageServiceImpl extends ServiceImpl<BsAircorpManageMapper, BsAircorpManageEntity> implements BsAircorpManageService {
	@Override
	public boolean saveAir(BsAircorpManageEntity bsAircorpManage) {
		// 创建人
		bsAircorpManage.setCreator(SecurityUtils.getUser().getName());
		//创建时间
		bsAircorpManage.setCreateTime(LocalDateTime.now());
		//绑定对接人为登录人
		bsAircorpManage.setCooperater(SecurityUtils.getUser().getName());
		//-- 目前一个accout 账号可对接多家航空公司
		//后期 需要动态绑定账户
		bsAircorpManage.setCooperaterId(SecurityUtils.getUser().getId());
		bsAircorpManage.setLockFlag("0");
		bsAircorpManage.setDeleteFlag("0");
		baseMapper.insert(bsAircorpManage);
		return true;
	}
}